package LocalServerMains;
import generalClasses.ProgramData;
import generalClasses.Server;
import udpKuponServer.SouthMulticastServer;
import LocalServerTcp.SouthLocalKuponsMultiServer;
import LocalServerThreads.RegistrationThread;


public class SouthLocalServerRun
{

	public static volatile int numOfMsgsSentNorth = 0;
	public static volatile int numOfMsgsSentCenter = 0;
	public static volatile int numOfMsgsSentSouth = 0;
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		ProgramData programData=new ProgramData();
		Server southServer = new Server("Server of the South (Eilat)",
										programData.getSouthServerAdress(),
										programData.getSouthServerPort(),
										ProgramData.LOCAL_SERVER, 
										ProgramData.ONLINE, 
										ProgramData.SOUTH);
		
		
		RegistrationThread registrationThread = new RegistrationThread( southServer );
		registrationThread.start();

		String[] emptyStringArray = {};
		try
		{
			SouthMulticastServer sms = new SouthMulticastServer();
			sms.main( emptyStringArray );
			
			SouthLocalKuponsMultiServer slkms = new SouthLocalKuponsMultiServer();
			slkms.main( emptyStringArray );
		}
		catch (Exception e)
		{
			e.printStackTrace();
			System.err.println("Exception cought in TempRunLocalServer: "+ e.getMessage() );
		}
	}

}